<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Bree: Project : Main</title>
</head>

<h:body>
	<h1>Main : Projects</h1>
	<h:form>

		<h:dataTable id="table1" value="#{projectBean.projects}" var="project"
			border="1">
			<f:facet name="header">
				<h:outputText value="Project List" />
			</f:facet>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Code" />
				</f:facet>
				<h:outputText value="#{project.code}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Description" />
				</f:facet>
				<h:outputText value="#{project.description}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Action" />
				</f:facet>
				<h:commandButton type="submit" value="Edit Project"
					action="#{projectBean.edit(project.id)}"></h:commandButton>
				<h:commandButton type="submit" value="Delete Project"
				    onclick="if(! confirm('Do you really want to delete this project?')) return false"
					action="#{projectBean.delete(project.id)}"></h:commandButton>
			</h:column>
		</h:dataTable>

		<h:commandButton type="submit" value="Create Project" action="create"></h:commandButton>
		<h:commandButton type="submit" value="Back to Main" action="back"></h:commandButton>
	</h:form>

</h:body>
</html>